import 'package:card_swiper/card_swiper.dart';
import 'package:flutter/material.dart';

class CommonSwiper extends StatelessWidget {

  final List<String> images;

  CommonSwiper(this.images);

  @override
  Widget build(BuildContext context) {
    return Container(
      padding: EdgeInsets.all(10),
      margin: EdgeInsets.all(5),
      decoration: BoxDecoration(
        color: Colors.white,
        borderRadius: BorderRadius.circular(10),
      ),
      height: 200,
      child: Swiper(
        itemBuilder: (BuildContext context,int index){
          return Image.network(images[index],fit: BoxFit.fill,);
        },
        itemCount: images.length,
        autoplay: true,
        pagination: SwiperPagination(
          builder: SwiperPagination.dots,
        ),
        control: SwiperControl(
          size: 15
        ),
      ),
    ) ;
  }
}
